home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / uemlsrc.arc / ueasm.s < prev    next >
Text File  |  1987-08-24  |  3KB  |  98 lines

  1. *************************************************************************
  2. * Add all of this to your gemstart.s file.  You will need the latest
  3. * version.  It is copyrighted, or I would include it also.  You need
  4. * the stack variable to allow shell commands.  The __BDOS function is
  5. * a bug fix.  The copy function handles screens in the terminal section.
  6. * The getmem function is for rettpa.  I include gemdos-xbios in my
  7. * startup so that link68 does not have to load osbind.o.
  8. *************************************************************************
  9. *
  10. * STACK variable summary:
  11. *       -1=keep all
  12. *        0=keep MINSTACK bytes
  13. *        1=keep 1/4 of free memory
  14. *        2=keep 2/4
  15. *        3=keep 3/4
  16. *        4=use _STKSIZ: keep (if >0) or give up (if <0) _STKSIZ bytes.
  17. *    other=keep that many bytes (positive) or give back that many (negative)
  18.  
  19. STACK=4                 * CHANGE THIS VARIABLE TO CHOOSE A MEMORY MODEL
  20. *
  21. * Surprise, the trap #2 vector is largely a do nothing routine.
  22. * Redirecting the basic calls may help solve a few problems.
  23. *
  24.         .globl ___BDOS
  25.  
  26. ___BDOS:
  27.         link    A6,#-4
  28.         cmpi.w  #9,$8(A6)
  29.         beq     togem
  30.         cmpi.w  #2,$8(A6)
  31.         beq     togem
  32.         cmpi.w  #1,$8(A6)
  33.         beq     togem
  34.         cmpi.w  #26,$8(A6)
  35.         bne     bdos
  36. togem:
  37.         move.l  $a(A6),(sp)     * value
  38.         move.w  $8(A6),-(sp)    * function
  39.         bsr     _gemdos
  40.         addq.l  #2,sp
  41.         bra     out
  42. bdos:
  43.         move.l  $a(A6),d1       * value
  44.         move.w  $8(A6),d0       * function
  45.         trap    #2              * Enter BDOS
  46.         cmpa.l  __break,sp      * Check for stack ovf
  47.         bcs     __sovf          * overflow! print msg and abort
  48.  
  49. out:    unlk    A6              * no error; return
  50.         rts                     * Back to caller
  51.  
  52. *
  53. *       GEMDOS, BIOS, and XBIOS calls
  54. *
  55.         .globl  _gemdos
  56.         .globl  _bios
  57.         .globl  _xbios
  58. _gemdos:
  59.         move.l  (sp)+,biosret
  60.         trap    #1
  61.         move.l  biosret,-(sp)
  62.         rts
  63. *
  64. _bios:  move.l  (sp)+,biosret
  65.         trap    #13
  66.         move.l  biosret,-(sp)
  67.         rts
  68. *
  69. _xbios: move.l  (sp)+,biosret
  70.         trap    #14
  71.         move.l  biosret,-(sp)
  72.         rts
  73. *       from _Programming the 68000_ by Steve Williams
  74. *       copy(src,dst,length);
  75. *       char    *src;
  76. *       char    *dst;
  77. *       int     length;
  78. *
  79.         .globl  _copy
  80. _copy:  move.l  4(a7),a0
  81.         move.l  8(a7),a1
  82.         move.w  12(a7),d0
  83.         sub.w   #1,d0
  84. loop:   move.b  (a0)+,(a1)+
  85.         dbra    d0,loop
  86.         rts
  87. *
  88. *       getmem function to return present top of memory
  89. *
  90.         .globl  _getmem
  91. _getmem:
  92.         move.l  a7,d0   * real simple and it works
  93.         rts
  94.         .bss
  95.         .even
  96. biosret:        .ds.l   1
  97.  
  98.